//
//  MyPaoPaoView.m
//  XDBaseFrameWork
//
//  Created by boyima on 14-10-28.
//  Copyright (c) 2014年 XD-XY. All rights reserved.
//

#import "MyPaoPaoView.h"

@implementation MyPaoPaoView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self makeViews];
    }
    return self;
}

- (id)initWithAnnotation:(id <BMKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    if (self) {
        [self makeViews];
    }
    return self;
}


- (void)makeViews{
    self.frame = CGRectMake(0, 0, 120, 44);
    self.backgroundColor = mClearColor;
    _bgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 120, 44)];
    _bgView.image = [UIImage imageNamed:@"myPaoPao@2x"];
    _bgView.userInteractionEnabled = YES;
    [self addSubview:_bgView];
    
    _headIV = [[UIImageView alloc] initWithFrame:CGRectMake(7, 5, 30, 30)];
    _headIV.userInteractionEnabled = YES;
    [self addSubview:_headIV];
    
    _titleLB= [UILabel initLabelText:nil andRect:CGRectMake(VIEW_POINT_MAX_X(_headIV), 2, 80, 18) andBackGroudColor:mClearColor andTextFont:[UIFont systemFontOfSize:15] andTextColor:UIColorFromRGB(0x666666) andTextAlignment:NSTextAlignmentLeft];
    [self addSubview:_titleLB];
    
    _subTitleLB = [UILabel initLabelText:nil andRect:CGRectMake(VIEW_POINT_MAX_X(_headIV), height_y(_titleLB), 80, 18) andBackGroudColor:mClearColor andTextFont:[UIFont systemFontOfSize:12] andTextColor:UIColorFromRGB(0x999999) andTextAlignment:NSTextAlignmentLeft];
    [self addSubview:_subTitleLB];
    
    UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(click:)];
    [self addGestureRecognizer:tap];
}

- (void)click:(UITapGestureRecognizer *)tap{
    [_delegate myPaoPaoViewClick:tap];
}

- (void)setDict:(NSDictionary *)dict{
    DDLOG(@"123");
}

@end
